package com.pzh.vue.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pzh.vue.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface SysUserMapper extends BaseMapper<SysUser> {
    @Update("UPDATE sys_user SET course=#{courseName} WHERE username = #{userName}")
    int selectCourse(@Param(value = "courseName") String courseName,@Param(value = "userName") String userName);
    @Select("select course from sys_user where username = #{username}")
    String isEmptyCourse(@Param("username") String userName);
    @Update("UPDATE sys_user SET course=#{courseName} WHERE username = #{userName}")
    int dropCourse(@Param("courseName") String courseName, @Param("userName") String userName);
    @Select("select role from sys_user where username=#{username}")
    String isRoot(@Param("username") String username);
    @Select("select file from sys_user where username = #{username}")
    String selectFileByName(@Param("username") String username);
    @Update("update sys_user set file =#{file} where username = #{username}")
    int updateFileURL(@Param("file") String fileUrl,@Param("username") String username);
    @Update("update sys_user set self_evaluation =#{evaluation} where username = #{username}")
    int updateSelfEvaluation(@Param("evaluation") String selfEvaluation,@Param("username") String username);
    @Select("select scores from sys_user where username = #{username}")
    String findScore(String username);
}
